#ifndef __DICTPRODUCER__HH__
#define __DICTPRODUCER__HH__

#include "Configuration.hh"
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>

using std::string;
using std::vector;
using std::map;
using std::set;
using std::pair;
using std::unordered_set;

class SplitTool;
class DictProducer
{
public:
    DictProducer(SplitTool* tool);
    void buildEnDict();
    void buildZhDict();
    void createIndex();
    void store();

private:
    void dataCleanEng(char*);
    void dataCleanZh(string&);
    bool isStopWordEn(string& );
    bool isStopWordZh(string& );
    void storeEnDict();
    void storeZhDict();
    void storeIndex();
private:
    vector<pair<string, int>> _dict;
    map<string, set<int>> _index;   // 这里的 string 是字母, set 是对应的 vector 索引
    SplitTool* _cuttor;
};

#endif